{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\vgonz\Dropbox\Pitt\OneDrive for Business\Dissertation - Vale\Paper 2 - Political-Economic Polarization\Replication\Log\2_2_Speech_US.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}29 Aug 2024, 15:39:56

{com}. do "C:\Users\vgonz\Dropbox\Pitt\OneDrive for Business\Dissertation - Vale\Paper 2 - Political-Economic Polarization\Replication\Do\2_2_Speech_US.do"
{txt}
{com}. *****************************************************************************
. *                                 Analysis Speech by MSA in the US                                      *
. *                                                                                                                                                       *                       
. * Author:                       Valentina Gonzalez Rostani                                                      *
. * Contact:                      mag384@pitt.edu                                                                 *
. * Date:                         August 9 2024                                                                                   *
. * Version:                      Stata 17                                                                                                *                                                                          
. *                                                                                                                                                       *
. *****************************************************************************
. /*
> This do-file:
> - Creates Table 2 and A15 using data from Trump Speeches. 
> 
> Input:
> - Data\Text\combined_df.csv // This file contains the data from speeches
> - Data\Rally_Visits_MSA.dta // This file contains information about the MSA (e.g, number of exposed workers)
> - Alternatively you can go to line 45 and use prepared data: 
>         - Data\Speech_MSA.dta
> 
> Output:
> - Table 2: Trump's Campaign Strategy: Speeches [Table\Trump_text_IVchanged.tex]
> - Table A15: Trump's Campaing Strategy: Speeches (Total count) [Table\Trump_text_IVchanged_count.tex]
> 
> */
. 
. *Defining Directory
. cd "C:\Users\vgonz\Dropbox\Pitt\OneDrive for Business\Dissertation - Vale\Paper 2 - Political-Economic Polarization\Replication"
{res}C:\Users\vgonz\Dropbox\Pitt\OneDrive for Business\Dissertation - Vale\Paper 2 - Political-Economic Polarization\Replication
{txt}
{com}. 
. * Merging MSA data with speeches - alternatively go to line 45
. {c -(}
. import delimited "Data\Text\combined_df.csv", clear
{res}{txt}(encoding automatically selected: UTF-8)
{text}(28 vars, 98 obs)
{com}. merge m:m msa_state using "Data\Rally_Visits_MSA.dta"
{res}
{txt}{col 5}Result{col 33}Number of obs
{col 5}{hline 41}
{col 5}Not matched{col 30}{res}             321
{txt}{col 9}from master{col 30}{res}               0{txt}  (_merge==1)
{col 9}from using{col 30}{res}             321{txt}  (_merge==2)

{col 5}Matched{col 30}{res}              98{txt}  (_merge==3)
{col 5}{hline 41}
{com}. keep if _merge==3
{txt}(321 observations deleted)
{com}. drop _merge 
. 
. // Generating the variables of interest regarding exposure of workers and hate crimes
.  
. gen high_pop_pop=(high_pop/Population) // Share of exposed workers 
. gen anti_pop=(anti/Population)*100000 
. 
. keep state  word_count  msa_state  pro_worker_count  culture_count  veryclose10 foreign  month  high_pop_pop   anti_pop 
. save "Data\Speech_MSA.dta", replace
{txt}{p 0 4 2}
file {bf}
Data\Speech_MSA.dta{rm}
saved
{p_end}
{com}. 
. {c )-}
{txt}
{com}. 
. * Alternatively you can call directly the data
. use "Data\Speech_MSA.dta", clear 
{txt}
{com}. 
. *******************************************************************************
. * Preparing variables
. *******************************************************************************
. {c -(}
. encode state, generate(state_num2)  // Encode 'state' as numeric
. encode msa_state, generate(msa_num)  // Encode 'msa_state' as numeric
. 
. // Calculate word shares
. gen pro_w = pro_worker_count / word_count  // Pro-worker word share
. gen pro_c = culture_count / word_count  // Pro-culture word share
. 
. // Create interaction terms
. gen int_exp_close = high_pop_pop * veryclose10  // Interaction: exposure x closeness
. gen int_exp_anti = high_pop_pop * anti_pop  // Interaction: exposure x hate incidents
. 
. // Label variables
. lab var veryclose10 "Close"  
. lab var int_exp_close "Exposed x Close"
. lab var int_exp_anti "Exposed x Hate"
. lab var high_pop_pop "Workers Exp. to Auto."
. lab var anti_pop "Hate Inc.x 100K Pop"
. 
. {c )-}
{txt}
{com}. *****************************************
. * Regression
. *****************************************
. {c -(}
. 
. //table 2: Trump's Campaign Strategy: Speeches
. {c -(}
. preserve  // Preserve the current dataset
. 
. keep if msa_num ~= .  // Keep observations with non-missing 'msa_num' (0 observations deleted)
{txt}(0 observations deleted)
{com}. 
. eststo clear  // Clear any previously stored estimates
. 
. // DV: Share of pro-worker rhetoric
. eststo: qui reg pro_w high_pop_pop veryclose10 i.month foreign anti_pop  i.state_num2, cluster(state_num2)
{txt}({res}est1{txt} stored)
{com}. eststo: qui reg pro_w high_pop_pop veryclose10 int_exp_close  i.month foreign anti_pop  i.state_num2, cluster(state_num2)
{txt}({res}est2{txt} stored)
{com}. eststo: qui reg pro_w high_pop_pop veryclose10 int_exp_close int_exp_anti i.month foreign anti_pop  i.state_num2,cluster(state_num2)
{txt}({res}est3{txt} stored)
{com}. 
. // DV: Share of pro-culture rhetoric
. eststo: qui reg pro_c high_pop_pop veryclose10 i.month foreign anti_pop i.state_num2 ,cluster(state_num2)
{txt}({res}est4{txt} stored)
{com}. eststo: qui reg pro_c high_pop_pop veryclose10 int_exp_close i.month foreign anti_pop  i.state_num2, cluster(state_num2)
{txt}({res}est5{txt} stored)
{com}. eststo: qui reg pro_c high_pop_pop veryclose10 int_exp_close int_exp_anti i.month foreign anti_pop  i.state_num2,cluster(state_num2)
{txt}({res}est6{txt} stored)
{com}. 
. // Create regression table
. esttab , replace label se ///
>     title("Trump's Campaign Strategy \label {c -(}TableSpeech2{c )-}") ///
>     compress nogap ///
>     star(* 0.1 ** 0.05 *** 0.01) ///
>     b(%6.3f) ///
>     keep(high_pop* anti* *close* int*) ///
>     scalars("N Observations" "r2 R$^2$" "aic AIC") ///
>     indicate("FE State = *state*" "Foreign = foreign*" "FE Month = *month") ///
>         nomtitle collabels(none) mgroups("Pro-worker Rhetoric (1-3)" "Cultural Rhetoric (4-6)", pattern(1 0 0 1 0 0)  ///
>         prefix(\multicolumn{c -(}@span{c )-}{c -(}c{c )-}{c -(}) suffix({c )-}) span)
{res}
{txt}Trump's Campaign Strategy \label {TableSpeech2}
{txt}{hline 94}
{txt}                 \multicolumn{3}{c}{Pro-worker Rhetoric (1-3)} \multicolumn{3}{c}{Cultural Rhetoric (4-6)}
{txt}                       (1)          (2)          (3)          (4)          (5)          (6)   
{txt}{hline 94}
{txt}Workers E.. to~.{res}     0.444***    -2.874***    -2.693***     0.024**      0.043        0.044   {txt}
                {res} {ralign 9:{txt:(}0.150{txt:)}}    {ralign 9:{txt:(}0.557{txt:)}}    {ralign 9:{txt:(}0.512{txt:)}}    {ralign 9:{txt:(}0.011{txt:)}}    {ralign 9:{txt:(}0.080{txt:)}}    {ralign 9:{txt:(}0.082{txt:)}}   {txt}
{txt}Close           {res}    -0.041***    -0.447***    -0.410***     0.007***     0.009        0.009   {txt}
                {res} {ralign 9:{txt:(}0.012{txt:)}}    {ralign 9:{txt:(}0.069{txt:)}}    {ralign 9:{txt:(}0.059{txt:)}}    {ralign 9:{txt:(}0.001{txt:)}}    {ralign 9:{txt:(}0.010{txt:)}}    {ralign 9:{txt:(}0.010{txt:)}}   {txt}
{txt}Hate Inc.x 100~p{res}    -0.047**     -0.051**      0.157**     -0.004**     -0.004**     -0.002   {txt}
                {res} {ralign 9:{txt:(}0.021{txt:)}}    {ralign 9:{txt:(}0.019{txt:)}}    {ralign 9:{txt:(}0.057{txt:)}}    {ralign 9:{txt:(}0.001{txt:)}}    {ralign 9:{txt:(}0.001{txt:)}}    {ralign 9:{txt:(}0.004{txt:)}}   {txt}
{txt}Exposed x Close {res}                  3.361***     3.060***                 -0.019       -0.021   {txt}
                {res}              {ralign 9:{txt:(}0.515{txt:)}}    {ralign 9:{txt:(}0.446{txt:)}}                 {ralign 9:{txt:(}0.081{txt:)}}    {ralign 9:{txt:(}0.084{txt:)}}   {txt}
{txt}Exposed x Hate  {res}                              -0.778***                              -0.007   {txt}
                {res}                           {ralign 9:{txt:(}0.210{txt:)}}                              {ralign 9:{txt:(}0.012{txt:)}}   {txt}
{txt}FE State        {res}       Yes          Yes          Yes          Yes          Yes          Yes   {txt}
{txt}Foreign         {res}       Yes          Yes          Yes          Yes          Yes          Yes   {txt}
{txt}FE Month        {res}       Yes          Yes          Yes          Yes          Yes          Yes   {txt}
{txt}{hline 94}
{txt}Observations    {res}        98           98           98           98           98           98   {txt}
{txt}R$^2$           {res}     0.503        0.537        0.571        0.336        0.336        0.337   {txt}
{txt}AIC             {res}  -320.397     -327.377     -332.854     -828.802     -828.840     -826.928   {txt}
{txt}{hline 94}
{txt}Standard errors in parentheses
{txt}* p<0.1, ** p<0.05, *** p<0.01
{com}.         
. // Create regression table
. esttab using "Table\Trump_text_IVchanged.tex", replace label se ///
>     title("Trump's Campaign Strategy \label {c -(}TableSpeech2{c )-}") ///
>     compress nogap ///
>     star(* 0.1 ** 0.05 *** 0.01) ///
>     b(%6.3f) ///
>     keep(high_pop* anti* *close* int*) ///
>     scalars("N Observations" "r2 R$^2$" "aic AIC") ///
>     indicate("FE State = *state*" "Foreign = foreign*" "FE Month = *month") ///
>         nomtitle collabels(none) mgroups("Pro-worker Rhetoric (1-3)" "Cultural Rhetoric (4-6)", pattern(1 0 0 1 0 0)  ///
>         prefix(\multicolumn{c -(}@span{c )-}{c -(}c{c )-}{c -(}) suffix({c )-}) span)
{res}{txt}(output written to {browse  `"Table\Trump_text_IVchanged.tex"'})
{com}. 
. 
. // Save regression table to a .tex file
. 
. 
. restore  // Restore the original dataset
. 
. /////
> {c )-}
. 
. // table A15: Trump's Campaing Strategy: Speeches (Total count)
. {c -(}
. preserve  // Preserve the current dataset
. 
. keep if msa_num ~= .  // Keep observations with non-missing 'msa_num' (0 observations deleted)
{txt}(0 observations deleted)
{com}. 
. eststo clear  // Clear any previously stored estimates
. 
. ********* Now number of words counts instead of share of words **************
. eststo clear
. eststo: qui reg pro_worker_count high_pop_pop  i.month foreign anti_pop i.state_num2 ,cluster(state_num2)
{txt}({res}est1{txt} stored)
{com}. eststo: qui reg pro_worker_count high_pop_pop veryclose10 foreign i.month  anti_pop  i.state_num2, cluster(state_num2)
{txt}({res}est2{txt} stored)
{com}. eststo: qui reg pro_worker_count high_pop_pop veryclose10 foreign int_exp_close  i.month  anti_pop  i.state_num2, cluster(state_num2)
{txt}({res}est3{txt} stored)
{com}. eststo: qui reg pro_worker_count high_pop_pop veryclose10 foreign int_exp_close int_exp_anti i.month  anti_pop  i.state_num2,cluster(state_num2)
{txt}({res}est4{txt} stored)
{com}. 
. eststo: qui reg culture_count high_pop_pop  i.month foreign anti_pop  i.state_num2 ,cluster(state_num2)
{txt}({res}est5{txt} stored)
{com}. eststo: qui reg culture_count high_pop_pop veryclose10 foreign i.month  anti_pop i.state_num2 ,cluster(state_num2)
{txt}({res}est6{txt} stored)
{com}. eststo: qui reg culture_count high_pop_pop veryclose10 int_exp_close foreign i.month  anti_pop  i.state_num2, cluster(state_num2)
{txt}({res}est7{txt} stored)
{com}. eststo: qui reg culture_count high_pop_pop veryclose10 int_exp_close foreign int_exp_anti i.month  anti_pop  i.state_num2,cluster(state_num2)
{txt}({res}est8{txt} stored)
{com}. 
. 
. esttab , replace label se title(Trump's Campaing Strategy: Speeches (Total count) \label {c -(}TableTotal{c )-})  nomtitle collabels(none) mgroups("Pro-worker Rhetoric (1-3)" "Cultural Rhetoric (4-6)", pattern(1 0 0 0 1 0 0 0)  ///
>         prefix(\multicolumn{c -(}@span{c )-}{c -(}c{c )-}{c -(}) suffix({c )-}) span) compress nogap star(* 0.1 ** 0.05 *** 0.01) b(%6.2f) keep(high_pop* anti* *close* int*)  scalars( "N Observations" "r2 R$^2$" "aic AIC" ) indicate("FE State = *state*" "Foreign = foreign*" "Fe Month =*month") 
{res}
{txt}Trump's Campaing Strategy: Speeches (Total count) \label {TableTotal}
{txt}{hline 120}
{txt}                 \multicolumn{4}{c}{Pro-worker Rhetoric (1-3)}       \multicolumn{4}{c}{Cultural Rhetoric (4-6)}        
{txt}                       (1)          (2)          (3)          (4)          (5)          (6)          (7)          (8)   
{txt}{hline 120}
{txt}Workers E.. to~.{res}    636.18       636.18     -4017.86***  -3658.56***    -12.97       -12.97       399.21       377.56   {txt}
                {res} {ralign 9:{txt:(}450.61{txt:)}}    {ralign 9:{txt:(}450.61{txt:)}}    {ralign 9:{txt:(}1375.41{txt:)}}    {ralign 9:{txt:(}1246.38{txt:)}}    {ralign 9:{txt:(}40.57{txt:)}}    {ralign 9:{txt:(}40.57{txt:)}}    {ralign 9:{txt:(}234.13{txt:)}}    {ralign 9:{txt:(}231.52{txt:)}}   {txt}
{txt}Hate Inc.x 100~p{res}   -119.44*     -119.44*     -124.44*      287.08        -3.23        -3.23        -2.79       -27.59   {txt}
                {res} {ralign 9:{txt:(}67.36{txt:)}}    {ralign 9:{txt:(}67.36{txt:)}}    {ralign 9:{txt:(}62.78{txt:)}}    {ralign 9:{txt:(}277.98{txt:)}}    {ralign 9:{txt:(}5.17{txt:)}}    {ralign 9:{txt:(}5.17{txt:)}}    {ralign 9:{txt:(}4.61{txt:)}}    {ralign 9:{txt:(}16.76{txt:)}}   {txt}
{txt}Close           {res}                 198.14***   -371.74**    -297.68*                    63.79***    114.26***    109.80***{txt}
                {res}              {ralign 9:{txt:(}28.05{txt:)}}    {ralign 9:{txt:(}168.17{txt:)}}    {ralign 9:{txt:(}144.97{txt:)}}                 {ralign 9:{txt:(}4.69{txt:)}}    {ralign 9:{txt:(}29.17{txt:)}}    {ralign 9:{txt:(}29.43{txt:)}}   {txt}
{txt}Exposed x Close {res}                             4714.86***   4116.91***                             -417.56*     -381.54*  {txt}
                {res}                           {ralign 9:{txt:(}1243.99{txt:)}}    {ralign 9:{txt:(}1063.07{txt:)}}                              {ralign 9:{txt:(}217.72{txt:)}}    {ralign 9:{txt:(}220.61{txt:)}}   {txt}
{txt}Exposed x Hate  {res}                                         -1542.64                                               92.95*  {txt}
                {res}                                        {ralign 9:{txt:(}985.93{txt:)}}                                           {ralign 9:{txt:(}51.69{txt:)}}   {txt}
{txt}FE State        {res}       Yes          Yes          Yes          Yes          Yes          Yes          Yes          Yes   {txt}
{txt}Foreign         {res}       Yes          Yes          Yes          Yes          Yes          Yes          Yes          Yes   {txt}
{txt}Fe Month        {res}       Yes          Yes          Yes          Yes          Yes          Yes          Yes          Yes   {txt}
{txt}{hline 120}
{txt}Observations    {res}        98           98           98           98           98           98           98           98   {txt}
{txt}R$^2$           {res}      0.38         0.38         0.40         0.42         0.50         0.50         0.51         0.51   {txt}
{txt}AIC             {res}   1222.34      1222.34      1220.39      1218.40       785.24       785.24       783.93       784.70   {txt}
{txt}{hline 120}
{txt}Standard errors in parentheses
{txt}* p<0.1, ** p<0.05, *** p<0.01
{com}. 
. esttab using "Table\Trump_text_IVchanged_count.tex", replace label se title(Trump's Campaing Strategy: Speeches (Total count) \label {c -(}TableTotal{c )-})  nomtitle collabels(none) mgroups("Pro-worker Rhetoric (1-4)" "Cultural Rhetoric (5-8)", pattern(1 0 0 0 1 0 0 0)  ///
>         prefix(\multicolumn{c -(}@span{c )-}{c -(}c{c )-}{c -(}) suffix({c )-}) span)  compress nogap star(* 0.1 ** 0.05 *** 0.01) b(%6.2f) keep(high_pop* anti* *close* int*)  scalars( "N Observations" "r2 R$^2$" "aic AIC" ) indicate("FE State = *state*" "Foreign = foreign*" "FE Month =*month") 
{res}{txt}(output written to {browse  `"Table\Trump_text_IVchanged_count.tex"'})
{com}. 
. 
. restore
. 
. /////
> {c )-}
. {c )-}
{txt}
{com}. 
{txt}end of do-file

{com}. do "C:\Users\vgonz\AppData\Local\Temp\STD7adc_000000.tmp"
{txt}
{com}. *****************************************************************************
. *                                 Analysis Speech by MSA in the US                                      *
. *                                                                                                                                                       *                       
. * Author:                       Valentina Gonzalez Rostani                                                      *
. * Contact:                      mag384@pitt.edu                                                                 *
. * Date:                         August 9 2024                                                                                   *
. * Version:                      Stata 17                                                                                                *                                                                          
. *                                                                                                                                                       *
. *****************************************************************************
. /*
> This do-file:
> - Creates Table 2 and A15 using data from Trump Speeches. 
> 
> Input:
> - Data\Text\combined_df.csv // This file contains the data from speeches
> - Data\Rally_Visits_MSA.dta // This file contains information about the MSA (e.g, number of exposed workers)
> - Alternatively you can go to line 45 and use prepared data: 
>         - Data\Speech_MSA.dta
> 
> Output:
> - Table 2: Trump's Campaign Strategy: Speeches [Table\Trump_text_IVchanged.tex]
> - Table A15: Trump's Campaing Strategy: Speeches (Total count) [Table\Trump_text_IVchanged_count.tex]
> 
> */
. 
. *Defining Directory
. cd "C:\Users\vgonz\Dropbox\Pitt\OneDrive for Business\Dissertation - Vale\Paper 2 - Political-Economic Polarization\Replication"
{res}C:\Users\vgonz\Dropbox\Pitt\OneDrive for Business\Dissertation - Vale\Paper 2 - Political-Economic Polarization\Replication
{txt}
{com}. 
. * Merging MSA data with speeches - alternatively go to line 45
. {c -(}
. import delimited "Data\Text\combined_df.csv", clear
{res}{txt}(encoding automatically selected: UTF-8)
{text}(28 vars, 98 obs)
{com}. merge m:m msa_state using "Data\Rally_Visits_MSA.dta"
{res}
{txt}{col 5}Result{col 33}Number of obs
{col 5}{hline 41}
{col 5}Not matched{col 30}{res}             321
{txt}{col 9}from master{col 30}{res}               0{txt}  (_merge==1)
{col 9}from using{col 30}{res}             321{txt}  (_merge==2)

{col 5}Matched{col 30}{res}              98{txt}  (_merge==3)
{col 5}{hline 41}
{com}. keep if _merge==3
{txt}(321 observations deleted)
{com}. drop _merge 
. 
. // Generating the variables of interest regarding exposure of workers and hate crimes
.  
. gen high_pop_pop=(high_pop/Population) // Share of exposed workers 
. gen anti_pop=(anti/Population)*100000 
. 
. keep state  word_count  msa_state  pro_worker_count  culture_count  veryclose10 foreign  month  high_pop_pop   anti_pop 
. save "Data\Speech_MSA.dta", replace
{txt}{p 0 4 2}
file {bf}
Data\Speech_MSA.dta{rm}
saved
{p_end}
{com}. 
. {c )-}
{txt}
{com}. 
. * Alternatively you can call directly the data
. use "Data\Speech_MSA.dta", clear 
{txt}
{com}. 
. *******************************************************************************
. * Preparing variables
. *******************************************************************************
. {c -(}
. encode state, generate(state_num2)  // Encode 'state' as numeric
. encode msa_state, generate(msa_num)  // Encode 'msa_state' as numeric
. 
. // Calculate word shares
. gen pro_w = pro_worker_count / word_count  // Pro-worker word share
. gen pro_c = culture_count / word_count  // Pro-culture word share
. 
. // Create interaction terms
. gen int_exp_close = high_pop_pop * veryclose10  // Interaction: exposure x closeness
. gen int_exp_anti = high_pop_pop * anti_pop  // Interaction: exposure x hate incidents
. 
. // Label variables
. lab var veryclose10 "Close"  
. lab var int_exp_close "Exposed x Close"
. lab var int_exp_anti "Exposed x Hate"
. lab var high_pop_pop "Workers Exp. to Auto."
. lab var anti_pop "Hate Inc.x 100K Pop"
. 
. {c )-}
{txt}
{com}. *****************************************
. * Regression
. *****************************************
. {c -(}
. 
. //table 2: Trump's Campaign Strategy: Speeches
. {c -(}
. preserve  // Preserve the current dataset
. 
. keep if msa_num ~= .  // Keep observations with non-missing 'msa_num' (0 observations deleted)
{txt}(0 observations deleted)
{com}. 
. eststo clear  // Clear any previously stored estimates
. 
. // DV: Share of pro-worker rhetoric
. eststo: qui reg pro_w high_pop_pop veryclose10 i.month foreign anti_pop  i.state_num2, cluster(state_num2)
{txt}({res}est1{txt} stored)
{com}. eststo: qui reg pro_w high_pop_pop veryclose10 int_exp_close  i.month foreign anti_pop  i.state_num2, cluster(state_num2)
{txt}({res}est2{txt} stored)
{com}. eststo: qui reg pro_w high_pop_pop veryclose10 int_exp_close int_exp_anti i.month foreign anti_pop  i.state_num2,cluster(state_num2)
{txt}({res}est3{txt} stored)
{com}. 
. // DV: Share of pro-culture rhetoric
. eststo: qui reg pro_c high_pop_pop veryclose10 i.month foreign anti_pop i.state_num2 ,cluster(state_num2)
{txt}({res}est4{txt} stored)
{com}. eststo: qui reg pro_c high_pop_pop veryclose10 int_exp_close i.month foreign anti_pop  i.state_num2, cluster(state_num2)
{txt}({res}est5{txt} stored)
{com}. eststo: qui reg pro_c high_pop_pop veryclose10 int_exp_close int_exp_anti i.month foreign anti_pop  i.state_num2,cluster(state_num2)
{txt}({res}est6{txt} stored)
{com}. 
. // Create regression table
. esttab , replace label se ///
>     title("Trump's Campaign Strategy \label {c -(}TableSpeech2{c )-}") ///
>     compress nogap ///
>     star(* 0.1 ** 0.05 *** 0.01) ///
>     b(%6.3f) ///
>     keep(high_pop* anti* *close* int*) ///
>     scalars("N Observations" "r2 R$^2$" "aic AIC") ///
>     indicate("FE State = *state*" "Foreign = foreign*" "FE Month = *month") ///
>         nomtitle collabels(none) mgroups("Pro-worker Rhetoric (1-3)" "Cultural Rhetoric (4-6)", pattern(1 0 0 1 0 0)  ///
>         prefix(\multicolumn{c -(}@span{c )-}{c -(}c{c )-}{c -(}) suffix({c )-}) span)
{res}
{txt}Trump's Campaign Strategy \label {TableSpeech2}
{txt}{hline 94}
{txt}                 \multicolumn{3}{c}{Pro-worker Rhetoric (1-3)} \multicolumn{3}{c}{Cultural Rhetoric (4-6)}
{txt}                       (1)          (2)          (3)          (4)          (5)          (6)   
{txt}{hline 94}
{txt}Workers E.. to~.{res}     0.444***    -2.874***    -2.693***     0.024**      0.043        0.044   {txt}
                {res} {ralign 9:{txt:(}0.150{txt:)}}    {ralign 9:{txt:(}0.557{txt:)}}    {ralign 9:{txt:(}0.512{txt:)}}    {ralign 9:{txt:(}0.011{txt:)}}    {ralign 9:{txt:(}0.080{txt:)}}    {ralign 9:{txt:(}0.082{txt:)}}   {txt}
{txt}Close           {res}    -0.041***    -0.447***    -0.410***     0.007***     0.009        0.009   {txt}
                {res} {ralign 9:{txt:(}0.012{txt:)}}    {ralign 9:{txt:(}0.069{txt:)}}    {ralign 9:{txt:(}0.059{txt:)}}    {ralign 9:{txt:(}0.001{txt:)}}    {ralign 9:{txt:(}0.010{txt:)}}    {ralign 9:{txt:(}0.010{txt:)}}   {txt}
{txt}Hate Inc.x 100~p{res}    -0.047**     -0.051**      0.157**     -0.004**     -0.004**     -0.002   {txt}
                {res} {ralign 9:{txt:(}0.021{txt:)}}    {ralign 9:{txt:(}0.019{txt:)}}    {ralign 9:{txt:(}0.057{txt:)}}    {ralign 9:{txt:(}0.001{txt:)}}    {ralign 9:{txt:(}0.001{txt:)}}    {ralign 9:{txt:(}0.004{txt:)}}   {txt}
{txt}Exposed x Close {res}                  3.361***     3.060***                 -0.019       -0.021   {txt}
                {res}              {ralign 9:{txt:(}0.515{txt:)}}    {ralign 9:{txt:(}0.446{txt:)}}                 {ralign 9:{txt:(}0.081{txt:)}}    {ralign 9:{txt:(}0.084{txt:)}}   {txt}
{txt}Exposed x Hate  {res}                              -0.778***                              -0.007   {txt}
                {res}                           {ralign 9:{txt:(}0.210{txt:)}}                              {ralign 9:{txt:(}0.012{txt:)}}   {txt}
{txt}FE State        {res}       Yes          Yes          Yes          Yes          Yes          Yes   {txt}
{txt}Foreign         {res}       Yes          Yes          Yes          Yes          Yes          Yes   {txt}
{txt}FE Month        {res}       Yes          Yes          Yes          Yes          Yes          Yes   {txt}
{txt}{hline 94}
{txt}Observations    {res}        98           98           98           98           98           98   {txt}
{txt}R$^2$           {res}     0.503        0.537        0.571        0.336        0.336        0.337   {txt}
{txt}AIC             {res}  -320.397     -327.377     -332.854     -828.802     -828.840     -826.928   {txt}
{txt}{hline 94}
{txt}Standard errors in parentheses
{txt}* p<0.1, ** p<0.05, *** p<0.01
{com}.         
. // Create regression table
. esttab using "Table\Trump_text_IVchanged.tex", replace label se ///
>     title("Trump's Campaign Strategy \label {c -(}TableSpeech2{c )-}") ///
>     compress nogap ///
>     star(* 0.1 ** 0.05 *** 0.01) ///
>     b(%6.3f) ///
>     keep(high_pop* anti* *close* int*) ///
>     scalars("N Observations" "r2 R$^2$" "aic AIC") ///
>     indicate("FE State = *state*" "Foreign = foreign*" "FE Month = *month") ///
>         nomtitle collabels(none) mgroups("Pro-worker Rhetoric (1-3)" "Cultural Rhetoric (4-6)", pattern(1 0 0 1 0 0)  ///
>         prefix(\multicolumn{c -(}@span{c )-}{c -(}c{c )-}{c -(}) suffix({c )-}) span)
{res}{txt}(output written to {browse  `"Table\Trump_text_IVchanged.tex"'})
{com}. 
. 
. // Save regression table to a .tex file
. 
. 
. restore  // Restore the original dataset
. 
. /////
> {c )-}
. 
. // table A15: Trump's Campaing Strategy: Speeches (Total count)
. {c -(}
. preserve  // Preserve the current dataset
. 
. keep if msa_num ~= .  // Keep observations with non-missing 'msa_num' (0 observations deleted)
{txt}(0 observations deleted)
{com}. 
. eststo clear  // Clear any previously stored estimates
. 
. ********* Now number of words counts instead of share of words **************
. eststo clear
. eststo: qui reg pro_worker_count high_pop_pop  i.month foreign anti_pop i.state_num2 ,cluster(state_num2)
{txt}({res}est1{txt} stored)
{com}. eststo: qui reg pro_worker_count high_pop_pop veryclose10 foreign i.month  anti_pop  i.state_num2, cluster(state_num2)
{txt}({res}est2{txt} stored)
{com}. eststo: qui reg pro_worker_count high_pop_pop veryclose10 foreign int_exp_close  i.month  anti_pop  i.state_num2, cluster(state_num2)
{txt}({res}est3{txt} stored)
{com}. eststo: qui reg pro_worker_count high_pop_pop veryclose10 foreign int_exp_close int_exp_anti i.month  anti_pop  i.state_num2,cluster(state_num2)
{txt}({res}est4{txt} stored)
{com}. 
. eststo: qui reg culture_count high_pop_pop  i.month foreign anti_pop  i.state_num2 ,cluster(state_num2)
{txt}({res}est5{txt} stored)
{com}. eststo: qui reg culture_count high_pop_pop veryclose10 foreign i.month  anti_pop i.state_num2 ,cluster(state_num2)
{txt}({res}est6{txt} stored)
{com}. eststo: qui reg culture_count high_pop_pop veryclose10 int_exp_close foreign i.month  anti_pop  i.state_num2, cluster(state_num2)
{txt}({res}est7{txt} stored)
{com}. eststo: qui reg culture_count high_pop_pop veryclose10 int_exp_close foreign int_exp_anti i.month  anti_pop  i.state_num2,cluster(state_num2)
{txt}({res}est8{txt} stored)
{com}. 
. 
. esttab , replace label se title(Trump's Campaing Strategy: Speeches (Total count) \label {c -(}TableTotal{c )-})  nomtitle collabels(none) mgroups("Pro-worker Rhetoric (1-4)" "Cultural Rhetoric (5-8)", pattern(1 0 0 0 1 0 0 0)  ///
>         prefix(\multicolumn{c -(}@span{c )-}{c -(}c{c )-}{c -(}) suffix({c )-}) span) compress nogap star(* 0.1 ** 0.05 *** 0.01) b(%6.2f) keep(high_pop* anti* *close* int*)  scalars( "N Observations" "r2 R$^2$" "aic AIC" ) indicate("FE State = *state*" "Foreign = foreign*" "Fe Month =*month") 
{res}
{txt}Trump's Campaing Strategy: Speeches (Total count) \label {TableTotal}
{txt}{hline 120}
{txt}                 \multicolumn{4}{c}{Pro-worker Rhetoric (1-4)}       \multicolumn{4}{c}{Cultural Rhetoric (5-8)}        
{txt}                       (1)          (2)          (3)          (4)          (5)          (6)          (7)          (8)   
{txt}{hline 120}
{txt}Workers E.. to~.{res}    636.18       636.18     -4017.86***  -3658.56***    -12.97       -12.97       399.21       377.56   {txt}
                {res} {ralign 9:{txt:(}450.61{txt:)}}    {ralign 9:{txt:(}450.61{txt:)}}    {ralign 9:{txt:(}1375.41{txt:)}}    {ralign 9:{txt:(}1246.38{txt:)}}    {ralign 9:{txt:(}40.57{txt:)}}    {ralign 9:{txt:(}40.57{txt:)}}    {ralign 9:{txt:(}234.13{txt:)}}    {ralign 9:{txt:(}231.52{txt:)}}   {txt}
{txt}Hate Inc.x 100~p{res}   -119.44*     -119.44*     -124.44*      287.08        -3.23        -3.23        -2.79       -27.59   {txt}
                {res} {ralign 9:{txt:(}67.36{txt:)}}    {ralign 9:{txt:(}67.36{txt:)}}    {ralign 9:{txt:(}62.78{txt:)}}    {ralign 9:{txt:(}277.98{txt:)}}    {ralign 9:{txt:(}5.17{txt:)}}    {ralign 9:{txt:(}5.17{txt:)}}    {ralign 9:{txt:(}4.61{txt:)}}    {ralign 9:{txt:(}16.76{txt:)}}   {txt}
{txt}Close           {res}                 198.14***   -371.74**    -297.68*                    63.79***    114.26***    109.80***{txt}
                {res}              {ralign 9:{txt:(}28.05{txt:)}}    {ralign 9:{txt:(}168.17{txt:)}}    {ralign 9:{txt:(}144.97{txt:)}}                 {ralign 9:{txt:(}4.69{txt:)}}    {ralign 9:{txt:(}29.17{txt:)}}    {ralign 9:{txt:(}29.43{txt:)}}   {txt}
{txt}Exposed x Close {res}                             4714.86***   4116.91***                             -417.56*     -381.54*  {txt}
                {res}                           {ralign 9:{txt:(}1243.99{txt:)}}    {ralign 9:{txt:(}1063.07{txt:)}}                              {ralign 9:{txt:(}217.72{txt:)}}    {ralign 9:{txt:(}220.61{txt:)}}   {txt}
{txt}Exposed x Hate  {res}                                         -1542.64                                               92.95*  {txt}
                {res}                                        {ralign 9:{txt:(}985.93{txt:)}}                                           {ralign 9:{txt:(}51.69{txt:)}}   {txt}
{txt}FE State        {res}       Yes          Yes          Yes          Yes          Yes          Yes          Yes          Yes   {txt}
{txt}Foreign         {res}       Yes          Yes          Yes          Yes          Yes          Yes          Yes          Yes   {txt}
{txt}Fe Month        {res}       Yes          Yes          Yes          Yes          Yes          Yes          Yes          Yes   {txt}
{txt}{hline 120}
{txt}Observations    {res}        98           98           98           98           98           98           98           98   {txt}
{txt}R$^2$           {res}      0.38         0.38         0.40         0.42         0.50         0.50         0.51         0.51   {txt}
{txt}AIC             {res}   1222.34      1222.34      1220.39      1218.40       785.24       785.24       783.93       784.70   {txt}
{txt}{hline 120}
{txt}Standard errors in parentheses
{txt}* p<0.1, ** p<0.05, *** p<0.01
{com}. 
. esttab using "Table\Trump_text_IVchanged_count.tex", replace label se title(Trump's Campaing Strategy: Speeches (Total count) \label {c -(}TableTotal{c )-})  nomtitle collabels(none) mgroups("Pro-worker Rhetoric (1-4)" "Cultural Rhetoric (5-8)", pattern(1 0 0 0 1 0 0 0)  ///
>         prefix(\multicolumn{c -(}@span{c )-}{c -(}c{c )-}{c -(}) suffix({c )-}) span)  compress nogap star(* 0.1 ** 0.05 *** 0.01) b(%6.2f) keep(high_pop* anti* *close* int*)  scalars( "N Observations" "r2 R$^2$" "aic AIC" ) indicate("FE State = *state*" "Foreign = foreign*" "FE Month =*month") 
{res}{txt}(output written to {browse  `"Table\Trump_text_IVchanged_count.tex"'})
{com}. 
. 
. restore
. 
. /////
> {c )-}
. {c )-}
{txt}
{com}. 
{txt}end of do-file

{com}. exit, clear
